$(function(){
  $('.page:not(#loading),#menu').hide();
  $('#loading .wave').animate({
      top:'-5px',
      left:'0px'
    },{
      duration: 10000,
      step:function(num,tween){
        if(tween.prop == "left"){
          var val = 100 + Math.floor(100*num/500);
          $('.percent').text(val+'%');
        }
      },
      complete:function(){
        $('#loading').fadeOut(400,function(){
          $('.page:not(#loading)').fadeIn(function(){
            $('#menu').fadeIn();
            _g.isLoaded = true;
          });
        });
      }
    });

});